﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace GameJam2012
{
    public class Food : Entity
    {
        public Food(int x, int y)
            : base()
        {
            Position = new Vector2(x + .5f, y + .5f) * SnakeGame.TILESIZE;
        }

        public override void Draw(SpriteBatch spriteBatch, float xOffset, float yOffset, Color tint)
        {
            spriteBatch.Draw(SnakeGame.MEAT, Position + new Vector2(xOffset, yOffset), null, tint, 0f, new Vector2(32, 32), 1f, SpriteEffects.None, .5f);
        }

        public override void CollideWith(Entity e)
        {
            if (e is PlayerEntity)
            {
                Kill();
                currentLevel.ps.Gush(Position);
                //SnakeGame.BLOOD.Play();
            }
        }

        public override FloatRectangle GetBoundingBox()
        {
            return new FloatRectangle(Position.X - 16, Position.Y - 16, 32, 32);
        }
    }
}
